<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<style>
.editPic{
border: 1px solid #cccccc;
    /* padding: 10px; */
    text-align: right;
}
.editpiclink{
       /* position: relative; */
    /* right: 0px; */
    text-align: center;
    /* width: 54px; */
    /* display: inline; */
    font-size: 10px;
    color: red;
    cursor: pointer;
}
.textbox-text-readonly {
color: cornflowerblue;
}
.editno{
width: 1px;
height:1px;
background: cornflowerblue;
}
</style>
<div style="padding:10px 10px 10px 10px">
	<form id="orderDetailForm" class="itemForm" method="post">
		<input type="hidden" name="id"/>
	    <table cellpadding="5">
	        <tr>
	            <td>订单编号:</td>
	            <td>
	            	<input class="easyui-textbox" type="text" name="orderId" style="width:200px;height:30px;"  data-options="readonly:'true'"/>
	            </td>
	        </tr>
	        <tr>
	            <td>支类型:</td>
	            <td><input class="easyui-textbox" type="text" name="paymentType" style="width:200px;height:30px;"  data-options="readonly:'true'"/>
				</td>
	        </tr>
	        <tr>
	            <td>订单状态:</td>
	            <td>
	            	<input class="easyui-textbox" name="orderstatus" style="width:200px;height:30px;"  data-options="readonly:'true'">	
				</td>
	        </tr>
	        	        <tr>
	            <td>手机号:</td>
	            <td>
	            	<input class="easyui-textbox" name="tel" style="width:200px;height:30px;"  data-options="readonly:'true'">	
				</td>
	        </tr>
	        <tr>
	            <td>收货人姓名:</td>
	            <td>
	                <input class="easyui-textbox" name="name" style="width:200px;height:30px;"  data-options="readonly:'true'">
	            </td>
	        </tr>
	        <tr>
	            <td>发货省份:</td>
	            <td>
	                <input class="easyui-textbox" name="provice" style="width:200px;height:30px;"  data-options="readonly:'true'">
	            </td>
	        </tr>
	        <tr>
	            <td>发货城市:</td>
	            <td>
	                <input class="easyui-textbox" name="city" style="width:200px;height:30px;"  data-options="readonly:'true'">
	        </tr>
	   		<tr>
	            <td>发货区县:</td>
	            <td>
	             <input class="easyui-textbox" name="area" style="width:200px;height:30px;"  data-options="readonly:'true'">
	        </tr>
	       <tr>
	            <td>街道信息:</td>
	            <td>
	             <input class="easyui-textbox" name="address" style="width:200px;height:30px;"  data-options="readonly:'true'">
	        </tr>
	        <tr>
	            <td>地址详情:</td>
	            <td>
	            	<input class="easyui-textbox" type="text" name="addressXq" style="width:300px;height:100px;" data-options="multiline:true,readonly:'true'"/>
	            </td>
	        </tr>
	        <tr>
	            <td>发货员ID:</td>
	            <td>
	            	<input class="easyui-textbox" type="text" name="senderid" style="width:300px;height:30px;" data-options="readonly:'true'"/>
	            </td>
	        </tr>
	        <tr>
	            <td>发货员名称:</td>
	            <td>
	            	<input class="easyui-textbox" type="text" name="sendername" style="width:300px;height:30px;" data-options="readonly:'true'"/>
	            </td>
	        </tr>
	        <tr>
	            <td>物流名称:</td>
	            <td>
	            	<input class="easyui-textbox" type="text" name="shippingName" style="width:400px;height:30px;" data-options="readonly:'true'"/>
	            </td>
	        </tr>
	        <tr>
	            <td>物流单号:</td>
	            <td>
	            	<input class="easyui-textbox" type="text" name="shippingCode" style="width:400px;height:30px;" data-options="readonly:'true'"/>
	            </td>
	        </tr>
	       <tr>
	            <td>买家留言:</td>
	            <td>
	            	<input class="easyui-textbox" type="text" name="buyerMessage" style="width:400px;height:100px" data-options="multiline:true,readonly:'true'"/>
	            </td>
	        </tr>
	        <tr>
	            <td>管理员备注信息:</td>
	            <td>
	            	<input class="easyui-textbox" type="text" name="remark" style="width:400px;height:100px" data-options="multiline:true,readonly:'true'"/>
	            </td>
	        </tr>
	        <tr>
	            <td>发货员备注信息:</td>
	            <td>
	            	<input class="easyui-textbox" type="text" name="senderRemark" style="width:400px;height:100px" data-options="multiline:true,readonly:'true'"/>
	            </td>
	        </tr>
	        <tr>
	    </table>
	</form>
		       <h1>产品信息</h1>
		        <table cellpadding="5" id="hiddenCcartId">
		        </table> 
	
</div>
<div id="itemdetailWindow" class="easyui-window" title="编辑商品" data-options="modal:true,closed:true,iconCls:'icon-save',href:'item-detail'" style="width:80%;height:80%;padding:10px;">
<script type="text/javascript">
function openItemDetail(itemId){
			var itemId =itemId;
	$("#itemdetailWindow").window({
		onLoad :function(){

			// 查看商品详情
			$.getJSON('./item/'+itemId,function(data){
				console.log(data)	
				if(data.benchmark==0){
					data.benchmark ="系统"
				}else{
					data.benchmark ="自定义"
				}
				// 加载商品描述
				$.getJSON('./item/cat/catname?catid='+data.cid,function(_data){
					console.log(_data)
					if(_data.status == 200 && _data.data){
						//UM.getEditor('itemeEditDescEditor').setContent(_data.data.itemDesc, false);
						data.catName = _data.data.name
						$("#itemedetailForm").form("load",data);
					}
				});
				var hiddenPhotoX =$("#hiddenPhotoX");
				var images="";
				var photoxs=data.photoX.split(",")
				for(var i =0;i<photoxs.length;i++){
					images +='<img src="'+photoxs[i]+'" alt="">';
				}
				hiddenPhotoX.html($(images));
				var itemEditEditor =$("#desc");
				
				// 加载商品描述
				$.getJSON('./item/query/desc/'+itemId,function(_data){
					console.log(_data)
					if(_data.status == 200 && _data.data){
						//UM.getEditor('itemeEditDescEditor').setContent(_data.data.itemDesc, false);
						itemEditEditor.html($(_data.data.itemDesc));
					}
				});

				
				//加载商品规格
				$.getJSON('./item/param/item/query?itemId='+itemId,function(_data){
					if(_data && _data.status == 200 && _data.data && _data.data.paramData){
						$("#itemedetailForm .params").show();
						$("#itemedetailForm [name=itemParams]").val(_data.data.paramData);
						$("#itemedetailForm [name=itemParamId]").val(_data.data.id);
						
						//回显商品规格
						 var paramData = JSON.parse(_data.data.paramData);
						
						 var html = "<ul>";
						 for(var i in paramData){
							 var pd = paramData[i];
							 html+="<li><table>";
							 html+="<tr><td colspan=\"2\" class=\"group\">"+pd.group+"</td></tr>";
							 
							 for(var j in pd.params){
								 var ps = pd.params[j];
								 html+="<tr><td class=\"param\"><span>"+ps.k+"</span>: </td><td><input autocomplete=\"off\" type=\"text\" value='"+ps.v+"'/></td></tr>";
							 }
							 
							 html+="</li></table>";
						 }
						 html+= "</ul>";
						 $("#itemedetailForm .params td").eq(1).html(html);
					}
				});
				
			})
/* 			
			
			
			//回显数据
			var data = $("#itemList").datagrid("getSelections")[0];
			data.priceView = TAOTAO.formatPrice(data.price);
			data.priceYhView = TAOTAO.formatPrice(data.priceYh);
			$("#itemeEditForm").form("load",data); */
			
			

		}
	}).window("open");
}

</script>
<style>
#hiddenCcartId tr td .easyui-textbox{
    border: 1px solid #95b8e7;
    border-radius: 4px;
    }
</style>

